package com.g001.model.abilities;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.MouseListener;
import org.newdawn.slick.geom.Shape;
import org.newdawn.slick.geom.Vector2f;
import org.newdawn.slick.state.StateBasedGame;

import com.g001.enums.AbilityType;

public abstract class Ability implements MouseListener {
	
	protected String name;
	protected AbilityType type;
	protected Image image;
	protected Vector2f position;
	protected Shape shape; // allow for detection on mouse event
	protected final static float shape_width = 45f;
	protected final static float shape_heigth = 45f;
	
	protected String resourceName = "data/g001/blocks.png"; // to load from the CachedResourceLoader
	protected boolean look2left;
	
	
	public abstract int getDamage();
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public AbilityType getType() {
		return type;
	}
	public void setType(AbilityType type) {
		this.type = type;
	}
 
	public Image getImage() {
		return image;
	}
	public void setImage(Image image) {
		this.image = image;
	}
	
	public abstract void render(GameContainer container, StateBasedGame game, Graphics g);
	
	public abstract void update(GameContainer container, StateBasedGame game, int delta);

	public Vector2f getPosition() {
		return position;
	}

	public void setPosition(Vector2f position) {
		this.position = position;
	}
	
	public boolean isMouseOnIt(int mouseX, int mouseY) {
		return shape.contains(mouseX, mouseY);
	}
		
	
}
